#include <iostream>
#include "cellPhone.h"

inline void enterNumber(ListNumber& listNumberEnter)
{
    unsigned int numbersEnters;
    std::cout<<"Please enter some integers from 2 to 9 (enter 0 to end):\n";
    do {
        std::cin>>numbersEnters;
        listNumberEnter.push_back (numbersEnters);  
    }while (numbersEnters);
}

void listStr(const ListNumber& listNumberEnter, ListString& lStr)
{
    for (std::list<int>::const_iterator it = listNumberEnter.begin(); it!= listNumberEnter.end(); ++it)
    {
    	switch(*it)
    	{
            case 2:
	            lStr.push_back("ABC");
	            break;    
            case 3:
	            lStr.push_back("DEF");
	            break;  
	        case 4:
	            lStr.push_back("GHI");
	            break;  
	        case 5:
	            lStr.push_back("JKL");
	            break;  
	        case 6:
	            lStr.push_back("MNO");
	            break;  
	        case 7:
	            lStr.push_back("PQRS");
	            break;  
	        case 8:
	            lStr.push_back("TUV");
	            break;   
	        case 9:
	            lStr.push_back("WXYZ");
	            break;                          
	        default:
	            std::cout<<"Numero incorrecto"<<std::endl;        
    	}
	}    
}

inline void showList(const ListString& lStr)
{
    for (std::list<std::string>::const_iterator itString = lStr.begin(); itString!= lStr.end(); ++itString)
    {
        std::cout<<*itString;
    }
    std::cout<<'\n';	
}

int main()
{
    enterNumber(list);
 	listStr(list, listStrOut);
 	showList(listStrOut);
 	return 0;
}
